<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>register</title>
<script type="text/javascript">
	function setCookie() {
		document.cookie = "loginId=abcd;";
		//document.cookie="username=gao;";	//不同名字的cookie不会互相影响
		document.cookie = "loginId=12345678;";//同名cookie可更改之前设置的值

		//var exp = new Date(); 				//设置cookie生命周期
		//exp.setTime(exp.getTime() + 90*24*60*60*1000);
		//document.cookie="expires=" + exp.toGMTString()+";";

		var expiration = new Date((new Date()).getTime() + 15 * 60000);
		document.cookie = "expires=" + expiration.toGMTString() + ";"
		document.cookie = "path=/;";
		document.cookie = "domain=.swb.com;";

		document.close();
	}

	function readCookie() {
		var cookieValue = "";
		document.write(document.cookie);
	}
</script>
</head>
<body>
	<form action="HandleRegist" method="post">
		用户Id：<input type="text" name="userId"><br /> 姓名：<input
			type="text" name="userName"><br /> 密码：<input type="text"
			name="userPwd"><br /> <input type="submit" value="注册 ">
		<br/>
	</form>
	<a href="login.jsp">去登陆</a>
	
	<!--  <form>
 <input type="button" value="setcookie" onClick="setCookie()">
  <input type="button" value="readcookie" onClick="readCookie()">
  </form>-->
</body>
</html>
